<!DOCTYPE html>
<html lang="en">

<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<meta http-equiv="X-UA-Compatible" content="ie=edge">
	<title>Document</title>
</head>

<body>
	<script>
		//函数声明
		function myFun() {
			alert("我是一个函数");
		}

		//myFun();
		//声明一个带参数
		function print(num) { //num 形参
				for (var i = 0; i < num i++) {
					document.write("hello world!<br />");
					//alert(num2+num1);
				}
		}
				print(10); //函数的调用
				add(1, 2);
				function add(num1, num2) {
					return num1 + num2;
				}

				console.log(add(3, 5));
		
	</script>
</body>

</html>